﻿using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace BankOcrDojo
{
    public static partial class BankOcrParser
    {
        internal static IEnumerable<IEnumerable<Ziffer>> ErkenneZiffern( IEnumerable<IEnumerable<SegmentZiffer>> segmentZiffernAllerSegmentZahlen )
        {
            Trace.WriteLine( string.Format( "ErkenneZiffern( {0} )", segmentZiffernAllerSegmentZahlen.Count() ) );

            foreach( var segmentZiffernEinerZahl in segmentZiffernAllerSegmentZahlen )
            {
                var listeSegmentZiffer = new List<Ziffer>();
                foreach( var segmentZiffer in segmentZiffernEinerZahl )
                {
                    listeSegmentZiffer.Add( m_SegmentZiffernAlsZiffern[segmentZiffer] );
                }
                yield return listeSegmentZiffer;
            }
        }
    }
}